package com.hup.utils.swing.view.viewTable2;

import com.hup.utils.swing.customView.HScrollPanel;
import com.hup.utils.swing.customView.viewTable2.ViewTable;
import com.hup.utils.swing.view.viewTable2.model.VMockPo;

import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

/**
 * @author hugan
 * @date 2024/5/28
 */
public class ViewTable2Form {
    public JPanel root;
    public ViewTable<VMockPo> table;
    public JPanel pVisibleColumn;
    public JPanel pButtons;

    {
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
        $$$setupUI$$$();
    }

    /**
     * Method generated by IntelliJ IDEA GUI Designer
     * >>> IMPORTANT!! <<<
     * DO NOT edit this method OR call it in your code!
     *
     * @noinspection ALL
     */
    private void $$$setupUI$$$() {
        createUIComponents();
        root = new JPanel();
        root.setLayout(new GridBagLayout());
        final JScrollPane scrollPane1 = new JScrollPane();
        GridBagConstraints gbc;
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 2;
        gbc.weightx = 1.0;
        gbc.weighty = 1.0;
        gbc.fill = GridBagConstraints.BOTH;
        root.add(scrollPane1, gbc);
        scrollPane1.setViewportView(table);
        final HScrollPanel hScrollPanel1 = new HScrollPanel();
        hScrollPanel1.setPreferredSize(new Dimension(10, 38));
        hScrollPanel1.setVerticalScrollBarPolicy(21);
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 1;
        gbc.fill = GridBagConstraints.BOTH;
        root.add(hScrollPanel1, gbc);
        pVisibleColumn = new JPanel();
        pVisibleColumn.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
        hScrollPanel1.setViewportView(pVisibleColumn);
        pButtons = new JPanel();
        pButtons.setLayout(new FlowLayout(FlowLayout.CENTER, 10, 0));
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.BOTH;
        root.add(pButtons, gbc);
        final JButton button1 = new JButton();
        button1.setText("setData");
        pButtons.add(button1);
        final JButton button2 = new JButton();
        button2.setText("addData");
        pButtons.add(button2);
        final JButton button3 = new JButton();
        button3.setText("clearData");
        pButtons.add(button3);
        final JButton button4 = new JButton();
        button4.setText("resetSort");
        pButtons.add(button4);
        final JButton button5 = new JButton();
        button5.setText("更新0");
        pButtons.add(button5);
    }

    /**
     * @noinspection ALL
     */
    public JComponent $$$getRootComponent$$$() {
        return root;
    }

    private void createUIComponents() {
        table = new ViewTable<>(VMockPo.class);
    }
}
